1. Field of the Invention
The present inventions relate to at least one image processing apparatus, at least one image processing method, at least one program, and at least one computer-readable storage medium for storing the at least one program, and more particularly, to interpolation techniques of a color image signal.
2. Description of the Related Art
In a conventional color image sensor, a Bayer pattern color filter array such as that illustrated in FIG. 17 is used. The color filter array may be a three primary color filter array including array elements of three colors of red (R), green (G), and blue (B), or a complementary color filter array including array elements of three colors of cyan, magenta, and yellow.
However, in the Bayer pattern color filter array, each pixel is allowed to obtain a signal of only one of three colors, and thus signals of the other two colors are missed. Therefore, to reproduce signals of the other two colors missing at each pixel, a demosaicing (interpolation) process is performed. Specific examples of known techniques for the demosaicing process include bilinear interpolation, bicubic interpolation, and the like. The bilinear or bicubic interpolation achieves good interpolation for an image in which low frequency components are dominant. However, for an image including a high frequency component, there is a possibility that the bilinear or bicubic interpolation generates a line or a color called a spurious resolution or a false color (color moire) that does not actually exist in an object. Such a spurious resolution or a false color may occur when demosaicing is performed using pixels in a direction different from a direction in which an edge of an object image extends.
In view of the above, it has been proposed to perform demosaicing using pixels along a direction of an edge of an object image. The demosaicing method using pixels along an edge direction is roughly classified into two methods. A first method is disclosed, for example, in Japanese Patent Laid-Open No. 2008-35470. In this method, an edge direction is detected using neighboring pixels, and interpolation is performed not across the edge but along the edge direction. Japanese Patent Laid-Open No. 2008-35470 also discloses a second interpolation method. In this second method, first, interpolation is performed separately in a plurality of directions to obtain a plurality of interpolation results. Thereafter the interpolation results are evaluated to select a best direction in which the interpolation is to be performed. It has been proposed to evaluate the properness of the interpolation direction such that an evaluation value representing uniformity among neighboring pixels including a pixel of interest is determined. A direction in which uniformity is high is determined as being an edge direction, and this direction is selected as an interpolation direction.
However, in the methods disclosed in Japanese Patent Laid-Open No. 2008-35470, there is a possibility that when an image has a component close to a resolution limit in which a pitch of a fine part of an object is close to a pixel pitch of an image sensor, the calculated evaluation value of the uniformity may be incorrect, which may result in an interpolation error which in turn may cause a spurious resolution to occur.